#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std; 

struct person_t {
	int id; 
	int wt; 
}; 

bool cmp(person_t &a, person_t &b)
{
	return a.wt==b.wt ? (a.id<b.id) : (a.wt<b.wt); 
}

int main()
{
	vector<person_t> a; 
	unsigned n, i, t; 
	double wt=0, sum=0, avg; 

	//freopen("p1223.in", "r", stdin); 
	cin>>n; 
	a.resize(n); 
	for (i=0; i<n; i++) {
		a[i].id = i+1; 
		cin>>a[i].wt; 
	}
	sort(a.begin(), a.end(), cmp); 

	/*
	for (i=0; i<n; i++) {
		cout<<a[i].id<<" "; 
	}
	cout<<"\n"; */

	for (i=0; i<n; i++) {
		sum += wt; 
		wt += a[i].wt; 
		if (i!=0) 
			printf(" "); 
		printf("%d", a[i].id); 
	}
	printf("\n"); 
	avg = sum / n; 
	printf("%.2lf\n", avg); 
	return 0; 
}


